<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo croppic</title>

    <!-- Bootstrap core CSS -->
    <link href="assets/css/bootstrap.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="assets/css/main.css" rel="stylesheet">
    <link href="assets/css/croppic.css" rel="stylesheet">
</head>

<body>

c


<div class="container">
    <div class="row mt ">
        <div class="col-lg-4 ">
            <div id="cropContainerPreload"></div>
        </div>
        <div class="col-lg-4 ">
            <div id="cropContainerPlaceHolder2"></div>
        </div>
    </div>
</div>

<script src=" https://code.jquery.com/jquery-2.1.3.min.js"></script>

<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.mousewheel.min.js"></script>
<script src="croppic.js"></script>
<!--<script src="assets/js/main.js"></script>-->
<script>
    var width = 600;
    var height = 800;
    var trust_width = $('#cropContainerPreload').width();

    if (width > 300) {
        $('#cropContainerPreload').css('width', trust_width + 'px').css('height', (height * trust_width / width) + 'px' );
    } else {
        $('#cropContainerPreload').css('width', width + 'px').css('height', height + 'px' );
    }

    var croppicContainerPreloadOptions = {
        // uploadUrl:'img_save_to_file.php',
        cropUrl:'https://qj.xiwed.cn/api/s2/crop_save',
        loadPicture:'http://qiniu.juhuibei.com/tmp/wx3ea377e9cef7406f.o6zAJszXGlNEO5PTwtzdTYS2nEEU.d9809bf81a9d56e683ee2143f3210fda.png',
        enableMousescroll:true,
        loaderHtml:'<div class="loader bubblingG"><span id="bubblingG_1"></span><span id="bubblingG_2"></span><span id="bubblingG_3"></span></div> ',
        onBeforeImgUpload: function(){ console.log('onBeforeImgUpload') },
        onAfterImgUpload: function(){ console.log('onAfterImgUpload') },
        onImgDrag: function(){ console.log('onImgDrag') },
        onImgZoom: function(){ console.log('onImgZoom') },
        onBeforeImgCrop: function(){ console.log('onBeforeImgCrop') },
        onAfterImgCrop:function(e){
            console.log('e', e);
            console.log('onAfterImgCrop');

        },
        onReset:function(){ console.log('onReset') },
        onError:function(errormessage){ console.log('onError:'+errormessage) }
    }
    var cropContainerPreload = new Croppic('cropContainerPreload', croppicContainerPreloadOptions);
</script>
</body>
</html>
